package com.why.blog.common;

import lombok.Data;

import java.io.Serializable;

@Data
public class R implements Serializable {
    private String code = "200";
    private String msg = "请求成功";
    private Object data = null;

    public static R getInstance(String code, String msg) {
        R r = new R();
        r.code = code == null ? "200" : code;
        r.msg = msg;
        return r;
    }

    public static R getInstance(String code,String msg,Object data){
        R r = new R();
        r.code = code == null ? "200" : code;
        r.msg = msg;
        r.data = data;
        return r;
    }

}
